package asf.loaders
{
	import asf.core.Application;
	
	dynamic internal class AppLoaderItem
	{
		private var app:Application;
		private var node:XML;
		
		public var context:*;
		
		public function AppLoaderItem( p_node:XML, p_app:Application )
		{
			app = p_app;
			node = p_node;
		}
		
		public function get id( ):String
		{
			return app.getParsedValueOf( node.@id || node.id || node.@url );
		}
		
		public function get url( ):String
		{
			return app.getParsedValueOf( node.@url || node.url );
		}
		
		public function get type( ):String
		{
			return app.getParsedValueOf( node.@type || node.type ).toLowerCase( );
		}
		
		public function get pausedAtStart( ):Boolean
		{
			return node.@pausedAtStart == "true" || node.pausedAtStart == "true";
		}
		
		public function get preventCache( ):Boolean
		{
			return node.@preventCache == "true" || node.preventCache == "true";
		}
		
		public function get weight( ):Number
		{
			return Number( node.@weight || node.weight );
		}
		
		public function get maxTries( ):uint
		{
			return uint( node.@maxTries || node.maxTries );
		}
		
		public function get priority( ):Number
		{
			return Number( node.@priority || node.priority );
		}
	}
}